package com.example.Project.Class;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.google.gson.JsonObject;
import org.springframework.lang.Nullable;

import java.time.LocalDate;

public class queryMass {
    @JsonProperty("id")
    private int Id;
    @JsonProperty("name")
    private String Name;
    @Nullable
    @JsonProperty("start")
    private LocalDate Start;

    @Nullable
    @JsonProperty("end")
    private LocalDate End;


    @JsonProperty("type")
    private String Type;
    @JsonProperty("phone")
    private String Phone;



    public queryMass(int Id, String Name, LocalDate Start,LocalDate End, String Type, String Phone) {
        this.Id = Id;
        this.Name = Name;
        this.Start=Start;
        this.End=End;
        this.Type = Type;
        this.Phone = Phone;
    }
    public queryMass(){}

    public int getId() {
        return this.Id;
    }

    public String getName() {
        return this.Name;
    }

    public LocalDate getStart() {
        return this.Start;
    }
    public LocalDate getEnd() {
        return this.End;
    }

    public String getType() {
        return this.Type;
    }

    public String getPhone() {
        return this.Phone;
    }
    public JsonObject toJsonObject(){
        JsonObject jsonContent = new JsonObject();

        jsonContent.addProperty("id",this.Id);
        jsonContent.addProperty("name",this.Name);
        jsonContent.addProperty("start", String.valueOf(this.Start));
        jsonContent.addProperty("end", String.valueOf(this.End));
        jsonContent.addProperty("type",this.Type);
        jsonContent.addProperty("phone",this.Phone);
        return jsonContent;
    }
}

